package com.example.excelimporter.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author alg
 */
@RestController
@RequestMapping("/api/data-source")
@Tag(name = "Data Source Configuration", description = "API for managing data source configurations")
public class DataSourceConfigController {

    // 配置数据源链接信息
    public void dataSourceConfig() {

    }

    // 插叙数据源链接列表信息
    public void dataSourceConfigList() {

    }

    // 拉取数据表结构，初始化数据源配置（配置模板需要先加载表结构）
    @GetMapping("pullTableStruct")
    @Operation(summary = "Pull table structure", description = "Fetch and initialize table structure for data source configuration")
    @ApiResponse(responseCode = "200", description = "Table structure pulled successfully")
    @ApiResponse(responseCode = "400", description = "Invalid table name")
    public void pullTableStruct(
            @Parameter(description = "Name of the table to pull structure from") @RequestParam String tableName) {


    }

    // 修改单表配置，修改一些默认值，比如：创建时间，创建人，主键等
    @GetMapping("updateTableStruct")
    @Operation(summary = "Update table structure", description = "Update table configuration with default values")
    @ApiResponse(responseCode = "200", description = "Table structure updated successfully")
    @ApiResponse(responseCode = "400", description = "Invalid table name or configuration")
    public void updateTableStruct(
            @Parameter(description = "Name of the table to update") @RequestParam String tableName) {


    }

    @GetMapping("delTableStruct")
    @Operation(summary = "Delete table structure", description = "Remove table structure configuration")
    @ApiResponse(responseCode = "200", description = "Table structure deleted successfully")
    @ApiResponse(responseCode = "400", description = "Invalid table name")
    public void delTableStruct(
            @Parameter(description = "Name of the table to delete") @RequestParam String tableName) {


    }

    @GetMapping("listTableStruct")
    @Operation(summary = "List table structures", description = "Get list of configured table structures")
    @ApiResponse(responseCode = "200", description = "Table structures retrieved successfully")
    @ApiResponse(responseCode = "400", description = "Invalid table name")
    public void listTableStruct(
            @Parameter(description = "Name of the table to list") @RequestParam String tableName) {


    }

    @GetMapping("detailTableStruct")
    @Operation(summary = "Get table structure details", description = "Get detailed configuration of a table structure")
    @ApiResponse(responseCode = "200", description = "Table structure details retrieved successfully")
    @ApiResponse(responseCode = "400", description = "Invalid table name")
    public void detailTableStruct(
            @Parameter(description = "Name of the table to get details for") @RequestParam String tableName) {


    }

}
